#ifndef UDPSOCKET_HPP
#define UDPSOCKET_HPP

#include "sockets.hpp"

class SocketData;

class UdpSocket
{
	public:
	
	UdpSocket();
	UdpSocket( UdpSocket const& s );
	~UdpSocket();

	void close();

	void bind( int port ) const;

	void sendTo( char* buffer, int length, NetAddress& dest ) const;
	int recvFrom( char* buffer, int length, NetAddress& source) const;

	bool isValid() const;
	
	private:
	
	SocketData* data;
};

#endif // UDPSOCKET_HPP
